package logic

import (
	"go_wep_demo/dao/mysql"
	"go_wep_demo/dao/redis"
	"go_wep_demo/models"
	"strconv"
)

func SaveArticle(data *models.ParamSaveArticle) (id int64, err error) {
	id,err =  mysql.SaveArticle(data)
	if err != nil {
		return
	}
	err = redis.AddArticle(strconv.Itoa(int(id)))
	return
}
